package ArrayTest;
/*
动态初始化方式赋值
静态初始化赋值
 */
public class ArrayTest2 {
    public static void main(String[] args){
        int[] arr = new int[10];
        //for循环给数组赋值，遍历
        for(int i = 0; i < arr.length; i++){
            arr[i] = i;
            System.out.println("第"+i+"个元素"+arr[i]);
        }
        Object[] obj = new Object[10];
        for(int j = 0; j < obj.length; j++){
            System.out.println("第"+j+"个元素"+obj[j]);
        }
        Object obj1 = new Object();
        Object obj2 = new Object();
        Object obj3 = new Object();
        Object[] objs = {obj1,obj2,obj3};
        for(int x = 0; x < objs.length; x++){
            System.out.println(objs[x]);
        }
    }
}
